package random;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.TreeMap;

public class DrawSaw {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		final RandomWalk r = new RandomWalk();
		final RandomWalkFast rf = new RandomWalkFast();
		final int[][] stepSizes = {{1},{1,10000},{10000,9999}};
		final int[] stepSize = stepSizes[0];
		int max = 0;
		for(int j1:stepSize)
			max = j1>max?j1:max;
		final WalkRenderer rend = new WalkRenderer(800, 20);
		rend.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseClicked(MouseEvent e) {
				try {
//					System.out.println(r.drawASaw(stepSize,rend).stepLength);
					System.out.println(rf.drawASawShort(stepSize,rend).stepLength);
//					System.out.println(rf.drawASawShortHT2(stepSize,rend).stepLength);
//					System.out.println(rf.drawASawLongHT2(stepSize,rend).stepLength);
//					System.out.println(rf.drawASawShortHT1(stepSize,rend).stepLength);
//					System.out.println(rf.drawASawLongHT1(stepSize,rend).stepLength);
//					System.out.println(rf.drawASawLong(stepSize,rend).stepLength);
//					System.out.println(r.drawASawTri(stepSize,rend).stepLength);
//					System.out.println(r.drawSawHex(rend).stepLength);
//					System.out.println(r.drawSawHex2(rend).stepLength);
//					System.out.println(r.drawSawHexHT(rend).stepLength);
				} catch (ArrayIndexOutOfBoundsException e1) {
					r.SIZE<<=1;
					System.out.println("resize:"+r.SIZE);
				}
			}
			
		});

	}

}
